package com.ruoyi.base.service.impl;

import com.ruoyi.base.domain.SchoolArea;
import com.ruoyi.base.mapper.SchoolAreaMapper;
import com.ruoyi.base.service.ISchoolAreaService;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 校区档案Service业务层处理
 *
 * @author ruoyi
 * @date 2024-06-03
 */
@Service
public class SchoolAreaServiceImpl implements ISchoolAreaService {
    @Autowired
    private SchoolAreaMapper schoolAreaMapper;

    /**
     * 查询校区档案
     *
     * @param id 校区档案主键
     * @return 校区档案
     */
    @Override
    public SchoolArea selectSchoolAreaById(String id) {
        return schoolAreaMapper.selectSchoolAreaById(id);
    }

    /**
     * 查询校区档案列表
     *
     * @param schoolArea 校区档案
     * @return 校区档案
     */
    @Override
    public List<SchoolArea> selectSchoolAreaList(SchoolArea schoolArea) {
        return schoolAreaMapper.selectSchoolAreaList(schoolArea);
    }

    /**
     * 新增校区档案
     *
     * @param schoolArea 校区档案
     * @return 结果
     */
    @Override
    public int insertSchoolArea(SchoolArea schoolArea) {
        schoolArea.setId(UUID.randomUUID().toString());
        return schoolAreaMapper.insertSchoolArea(schoolArea);
    }

    /**
     * 修改校区档案
     *
     * @param schoolArea 校区档案
     * @return 结果
     */
    @Override
    public int updateSchoolArea(SchoolArea schoolArea) {
        return schoolAreaMapper.updateSchoolArea(schoolArea);
    }

    /**
     * 批量删除校区档案
     *
     * @param ids 需要删除的校区档案主键
     * @return 结果
     */
    @Override
    public int deleteSchoolAreaByIds(String[] ids) {
        return schoolAreaMapper.deleteSchoolAreaByIds(ids);
    }

    /**
     * 删除校区档案信息
     *
     * @param id 校区档案主键
     * @return 结果
     */
    @Override
    public int deleteSchoolAreaById(String id) {
        return schoolAreaMapper.deleteSchoolAreaById(id);
    }
}
